import { Navigate } from 'react-router-dom'
import Home from '../pages/home/index.jsx'
import Classify from '../pages/classify/index.jsx'
import Shop from '../pages/shop/index.jsx'
import Mine from '../pages/mine/index.jsx'
import Commodity from '../pages/commodity/index.jsx'
import Product from '../pages/commodity/product/index.jsx'
import Login from '../pages/login/index.jsx'

const router = [
    {
        path: '/',
        element: <Navigate to="home"/>
    },
    {
        path:'/home',
        element: <Home />
    },
    {
        path:'/classify',
        element: <Classify />
    },
    {
        path:'/shop',
        element: <Shop />
    },
    {
        path:'/mine',
        element: <Mine />
    },
    {
        path:'/commodity/:id',
        element: <Commodity />,
        children:[
            {
                path: '/commodity/:id/product/:id',
                element: <Product />
            }
        ]
    },
    {
        path:'/login',
        element: <Login />
    },
]

export default router